package com.lz.manage.model.vo.tagInfo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.lz.common.annotation.Excel;
import com.lz.manage.model.domain.TagInfo;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.Date;

/**
 * 标签信息Vo对象 t_tag_info
 *
 * @author YY
 * @date 2025-07-17
 */
@Data
public class TagInfoVo implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 标签编号
     */
    @Excel(name = "标签编号")
    private Long tagId;

    /**
     * 标签名字
     */
    @Excel(name = "标签名字")
    private String tagName;

    /**
     * 创建人
     */
    @Excel(name = "创建人")
    private String userName;
    private Long userId;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createTime;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date updateTime;

    /**
     * 备注
     */
    @Excel(name = "备注")
    private String remark;


    /**
     * 对象转封装类
     *
     * @param tagInfo TagInfo实体对象
     * @return TagInfoVo
     */
    public static TagInfoVo objToVo(TagInfo tagInfo) {
        if (tagInfo == null) {
            return null;
        }
        TagInfoVo tagInfoVo = new TagInfoVo();
        BeanUtils.copyProperties(tagInfo, tagInfoVo);
        return tagInfoVo;
    }
}
